<?php

/*

Vote (vote.php)

*/

$rank_check = 0;
$page_title = "Vote";
include "header.inc.php";

$thisWeek = "$this_year$this_week";

mysql_query("DELETE FROM vote_twg WHERE week != '$thisWeek'");

$vote = fetch("SELECT * FROM vote_twg WHERE userid = '$userid' AND week = '$thisWeek' LIMIT 1");

if (!$vote[vote2])
{
	points($game,$username,1000);
}

mysql_query("DELETE FROM vote_twg WHERE userid = '$userid'");

mysql_query("INSERT INTO vote_twg (userid,week,vote1,vote2) VALUES ('$userid','$thisWeek','$vote[vote1]','1')");

header("Location: http://www.apexwebgaming.com/in.php?game=$game&id=??");

?>